import { RouteRecordRaw } from 'vue-router'
import Home from '../views/Home/Home.vue'
// 对外导出配置路由(常量路由):全部用户都能访问到的路由
export const showroutes: Array<RouteRecordRaw> = [
    {
        path: "/",
        name: 'layout',
        component: () => import('../layout/index.vue'),
        meta: {
            hidden: false, //代表路由子啊菜单中标题是否隐藏
            icon: "Promotion"
        },
        redirect: "/home",
        children: [
            {
                path: "/home",
                component: Home,
                meta: {
                    title: "首页",
                    hidden: false, //代表路由子啊菜单中标题是否隐藏
                    icon: "HomeFilled"
                }
            }
        ]
    },
    {
        path: "/screen",
        name: 'screen',
        component: () => import('../views/screen/screen.vue'),
        meta: {
            title: "数据大屏",
            hidden: false, //代表路由子啊菜单中标题是否隐藏
            icon: "Histogram"
        }
    },
    {
        path: "/login",
        name: 'login',
        component: () => import('../views/Login/Logoin.vue'),
        meta: {
            title: "登录",
            hidden: true //代表路由子啊菜单中标题是否隐藏
        }
    },
    {
        path: "/404",
        name: '404',
        component: () => import('../views/404/404.vue'),
        meta: {
            title: "404",
            hidden: true //代表路由子啊菜单中标题是否隐藏
        }
    },
]

//异步路由
export const asyncRouter: Array<RouteRecordRaw> = [
    {
        path: "/acl",
        name: 'Acl',
        component: () => import('../layout/index.vue'),
        meta: {
            title: "权限管理",
            hidden: false, //代表路由子啊菜单中标题是否隐藏
            icon: "Setting"
        },
        redirect: "/acl/user",
        children: [
            {
                path: "/acl/user",
                component: import('../views/acl/Usermage/index.vue'),
                name: "User",
                meta: {
                    title: "用户管理",
                    hidden: false, //代表路由子啊菜单中标题是否隐藏
                    icon: "User"
                }
            },
            {
                path: "/acl/role",
                component: import('../views/acl/Rolemage/index.vue'),
                name: "Role",
                meta: {
                    title: "角色管理",
                    hidden: false, //代表路由子啊菜单中标题是否隐藏
                    icon: "View"
                }
            },
            {
                path: "/acl/muen",
                component: import('../views/acl/Muenmage/index.vue'),
                name: "Permission",
                meta: {
                    title: "菜单管理",
                    hidden: false, //代表路由子啊菜单中标题是否隐藏
                    icon: "Operation"
                }
            }
        ]
    },
    {
        path: "/product",
        name: 'Product',
        component: () => import('../layout/index.vue'),
        meta: {
            title: "商品管理",
            hidden: false, //代表路由子啊菜单中标题是否隐藏
            icon: "Goods",
        },
        redirect: "/product/trademark",
        children: [
            {
                path: "/product/trademark",
                component: import('../views/Goods/Trademark/trademark.vue'),
                name: "Trademark",
                meta: {
                    title: "饿了么管理",
                    hidden: false, //代表路由子啊菜单中标题是否隐藏
                    icon: "ShoppingCartFull"
                }
            },
            {
                path: "/product/attr",
                component: import('../views/Goods/Attr/index.vue'),
                name: "Attr",
                meta: {
                    title: "属性管理",
                    hidden: false, //代表路由子啊菜单中标题是否隐藏
                    icon: "ShoppingCartFull"
                }
            },
            {
                path: "/product/spu",
                name: "Spu",
                component: import('../views/Goods/SPU/index.vue'),
                meta: {
                    title: "SPU管理",
                    hidden: false, //代表路由子啊菜单中标题是否隐藏
                    icon: "ChromeFilled"
                }
            },
            {
                path: "/product/vxetable",
                name: "VxeTable",
                component: import('../views/Goods/VxeTable/VxeTable.vue'),
                meta: {
                    title: "VxeTable管理",
                    hidden: false, //代表路由子啊菜单中标题是否隐藏
                    icon: "ChromeFilled"
                }
            },
            {
                path: "/product/test",
                name: "Test",
                component: import('../views/Goods/Test/Test.vue'),
                meta: {
                    title: "Test管理",
                    hidden: false, //代表路由子啊菜单中标题是否隐藏
                    icon: "ChromeFilled"
                }
            },
            {
                path: "/product/antdtable",
                component: import('../views/Goods/antd/antdTable.vue'),
                name: "antdtable",
                meta: {
                    title: "antdTable管理",
                    hidden: false, //代表路由子啊菜单中标题是否隐藏
                    icon: "Operation"
                }
            }
        ]
    },
]

//任意路由
export const anyRouter: Array<RouteRecordRaw> = [
    {
        path: "/:pathMactch(.*)*",
        redirect: "/404",
        name: 'any',
        meta: {
            title: "任意路由",
            hidden: true //代表路由子啊菜单中标题是否隐藏
        }
    }
]


